//
//  LJYCommon.swift
//  ljy_demo
//
//  Created by xiandao on 2025/9/4.
//

import UIKit

let screenWidth = UIScreen.main.bounds.size.width
let screenHeight = UIScreen.main.bounds.size.height
let safeAreaTopHeight: CGFloat = (screenHeight >= 812.0 && UIDevice.current.model == "iPhone" ? 88 : 64)
let safeAreaBottomHeight: CGFloat = (screenHeight >= 812.0 && UIDevice.current.model == "iPhone"  ? 34 : 0)
let isIphoneX : Bool = kScreen_width >= 375.0 && kScreen_height >= 812.0
let ksafeBottom : CGFloat = (isIphoneX ? 34.0 : 0.0)
let ksafeStatusBarHeight : CGFloat = (isIphoneX ? 44.0 : 20.0)

// 屏幕的宽度
 public var kScreen_width: CGFloat {
    return UIScreen.main.bounds.size.width
 }

// 屏幕的高度
public var kScreen_height: CGFloat {
    return UIScreen.main.bounds.size.height
}

public var kNewWidthScale : CGFloat {
    return UIScreen.main.bounds.size.width/390.0
}

// 屏幕宽度比例
public var kNewHeightScale : CGFloat {
    return UIScreen.main.bounds.size.height/844.0
}

// 高度比列
public func kScaleHeight(h: CGFloat)->CGFloat {
    return UIScreen.main.bounds.size.height / 896.0 * h
}

// 宽度比
public func kScaleWidth(w: CGFloat)->CGFloat {
    return UIScreen.main.bounds.size.width / 414.0 * w
}

// 屏幕宽度比例
public var kWidthScale : CGFloat {
    return UIScreen.main.bounds.size.width/375.0
}

// 屏幕宽度比例
public var kHeightScale : CGFloat {
    return UIScreen.main.bounds.size.height/667.0
}

// 设置pickerView的高度
public var kPickerViewHeight: CGFloat {
   return 216
}

// 高度比列
public func k_scaleHeight(h: CGFloat)->CGFloat {
    return kScreen_height/844*h
}

// 宽度比
public func k_scaleWidth(w: CGFloat)->CGFloat {
    return kScreen_width/390*w
}

public func kNavHeight() -> CGFloat {
    return isIphoneX ? 88 : 64
}
